Ijraset Journal For Research in Applied Science and Engineering Technology
Authors: Ms. Reshma Ashreen, Ms. Preethi M, Ms. Rukmini Bhat B
DOI Link: https://doi.org/10.22214/ijraset.2024.66090
Certificate: View Certificate
This project presents a chatbot designed for medical diagnosis, leveraging machine learning to identify illnesses based on user-reported symptoms. The chatbot uses a trained neural network model to predict diseases and provide corresponding precautions. Implemented with Python and utilizing libraries such as PyTorch, scikit-learn, and spaCy, the system aims to enhance accessibility to preliminary medical advice. While not a replacement for professional diagnosis, this tool offers a convenient and immediate resource for health- related inquiries, demonstrating promising accuracy and user engagement in preliminary testing.
I. INTRODUCTION
One such application is the development of medical diagnostic chatbots, which leverage AI algorithms to provide preliminary health assessments based on user- reported symptoms. These chatbots have emerged as valuable tools in the digital health landscape, offering individuals immediate access to health information and guidance. Traditional healthcare systems often face challenges related to accessibility, especially in remote or underserved areas where access to medical professionals may be limited.
The integration of artificial intelligence (AI) and natural language processing (NLP) into various domains has revolutionized how tasks are performed, including in healthcare.Moreover, individuals experiencing mild symptoms or seeking general health advice may hesitate to visit healthcare facilities due to various reasons, including time constraints, cost concerns, or the perception of minor symptoms. In response to these challenges, medical diagnostic chatbots have emerged as a convenient and accessible solution. These chatbots typically employ machine learning models trained on extensive datasets of medical information to analyze user-input symptoms and provide relevant health insights. By leveraging AI and NLP technologies, these chatbots can understand natural language queries and deliver personalized responses, thereby simulating a conversation with a healthcare professional.
The designed bot can handle user requests and identify message patterns with an artificial intelligence markup language (AIML). AIML is an XML-based markup dialect to create natural language software agents and gives the real human interactive experience to users. The functionality of chatbot is defined in two ways: request analysis or return response. At first, chatbot evaluates the severity of the virus through feedback from a predefined questionnaire. Simultaneously, if the user fails to acknowledge precise answers, the bot will fail to provide the correct response. In its response return, after the evaluation of a patient’s condition, the chatbot provides an obvious response in the form of either generic text or text retrieved from the knowledge base response.
II. LITERATURE REVIEW
Chatbot for Healthcare System [1] The document provides an overview of machine learning algorithms used in chatbot platforms, focusing on their applications in natural language processing (NLP) and dialogue act recognition systems. It discusses various algorithms such as neural networks, regression, support vector, and semi-supervised learning, and their relevance to chatbot development. Additionally, it outlines the architecture of chatbot platforms, emphasizing the use of microservice architecture and containers for scalability and performance optimization. The document also highlights the importance of Bayesian approaches in dialogue act recognition systems and the use of machine learning algorithms to interpret user intentions.
III. METHODOLOGY
A. Model Development
NLP is used to give users a human chat-like and easy communication experience. The user input text has to be pre-processed so as to derive symptoms and proper keywords from it. Pre-processing methods – tokenization, Stop words removal, stemming, TF-IDF and Cosine Similarity can be used to generate an appropriate response for the user query.
B. Data Pre-Processing
Preprocess the data to remove inconsistencies, errors, and irrelevant information. Ensure data is anonymized to protect patient privacy. Collect diverse datasets including medical literature, patient records, symptom descriptions, conversational data, and examples of phishing messages.
C. Feature Selection
The feature selection (FS) process determines an optimal subset of features by eliminating irrelevant attributes to enhance learning accuracy. This subset is carefully chosen from the original feature set based on considerations of feature relevance and redundancy.
D. Model training
Choose suitable machine learning models such as recurrent neural networks (RNNs), long short-term memory networks (LSTMs), or transformer-based models (e.g., BERT, GPT). Train the selected models using the preprocessed and labeled data. Optimize the models for accuracy, relevance, and efficiency.
E. System Development
Develop the chatbot framework using platforms like Rasa, Dialogflow, or Microsoft Bot Framework. Integrate the chatbot with backend systems such as electronic health records (EHR), appointment scheduling systems, and databases. Implement APIs to facilitate communication between the chatbot and other healthcare systems and services.
IV. SYSTEM ARCHITECTURE
In this project the desktop application is designed using the Tkinter which is a standard Python interface to the Tk GUI toolkit, and is Python's de facto standard GUI. Tkinter is included with standard Linux, Microsoft Windows and macOS installs of Python. License. The front end interacts with the user to gather necessary information such as the user symptoms and symptom duration once the user submits his name on welcome screen he is redirected to the main interface which takes input symptoms once user enters a symptom the symptom is fed to feedforward neural network and the chatbot will ask the user a sequence of questions in a pop up the question will have a symptom that is related to the first input inquiring about whether he is suffering from it to which user has to answer yes or no if he inputs yes then the symptom is fed to the neural network the neural network model was developed through training and testing using a Kaggle dataset after one hot encoding and label encoding which contained 41 diseases and 133 symptom columns.
The system architecture for an AI and ML-powered healthcare chatbot is composed of several interconnected layers that ensure efficient, secure, and high-quality service delivery. The Machine Learning Models layer comprises intent recognition to understand user queries, entity extraction to identify relevant medical terms, and a phishing detection model to safeguard against cyber threats.
The dataset consists of 41 unique diseases and 133 columns of symptoms. This dataset was obtained from a Kaggle Repository which was utilized for training the mode. This dataset consists of disease information from various healthcare related resources to ensure diversity in training data, enhancing the model’s robustness and accuracy.
The input layer receives data from the user. In a healthcare chatbot, this data is usually text input from the user describing symptoms, asking medical questions, or seeking advice. Text input is often preprocessed and converted into numerical representations. The hidden layers process the input data through a series of transformations. Each neuron applies a weighted sum of inputs and passes the result through an activation function (e.g., ReLU, sigmoid).Multiple hidden layers can capture complex patterns in the data, such as the relationships between symptoms and potential conditions.
The output layer produces the final result, which could be a classification (e.g., identifying the type of question) or a prediction (e.g., suggesting a potential diagnosis).
Basic FNN architecture
A. Data Preprocessing
Text Tokenization: The input text is split into individual tokens (words or subwords).Vectorization: Tokens are converted into numerical vectors using techniques like word embeddings (Word2Vec, GloVe) or transformer-based embeddings (BERT, GPT).Normalization: Numerical vectors are normalized to ensure consistent scale across features.
B. Forward Propagation
The input vectors are fed into the neural network. Each layer computes a linear combination of the inputs, applies an activation function, and passes the result to the next layer. Security is a top priority, managed by the Security Layer, which employs data encryption, authentication, authorization mechanisms, and maintains audit logs for compliance. This layer is responsible for tracking system performance, identifying and resolving errors, and maintaining logs for troubleshooting. It also includes a user feedback loop for continuous improvement based on user input.
C. Output Generation
The final layer's output determines the response of the chatbot. In a healthcare context, this could be identifying the type of user inquiry (e.g., symptom description, medication query), suggesting potential diagnoses, or providing relevant health advice. For classification tasks, the output might be a softmax layer that produces probabilities for each class.
V. RESULTS
Welcoming the user and asking for their name.
Fig. 1. Welcome Page
Fig. 2. Main Interface
In this interface the user can interact with the chatbot.
Once the user inputs his symptom a sequence of popup questions related to duration of the symptom and other related symptoms will be asked with the user to which he has to answer with yes or no.
Fig. 3. Result
Predicted disease with the measures to be taken.
Fig. 4. Options under File
Options to clear the chat and exit option to close the file options opened.
Fig. 5. Quit Operation
In conclusion, our healthcare chatbot project represents a significant step forward in leveraging technology to enhance healthcare accessibility and support. By integrating machine learning models, natural language processing, and user- friendly interfaces, we have developed a robust system capable of providing accurate and timely assistance to users seeking medical information. Through thorough testing and continuous refinement, we have ensured the reliability, performance, and security of our chatbot, paving the way for its successful deployment in real-world healthcare settings. This project underscores the potential of AI-driven solutions to positively impact healthcare delivery, empowering individuals to make informed decisions about their well- being while alleviating strain on healthcare resources. For future enhancements, integrating more advanced natural language processing (NLP) models could enhance the chatbot\'s understanding of user queries, improving accuracy and response quality. Additionally, incorporating personalized recommendations based on user medical history and preferences could further tailor the chatbot\'s assistance to individual needs. Furthermore, integrating voice recognition capabilities could make the chatbot more accessible and user-friendly, allowing users to interact with it hands-free.
[1] Tebenkov E, Prokhorov I. Machine learning algorithms for teaching AI chat bots. Procedia Computer Science. 2021 Jan 1;190:735-44. [2] Sushruth S, Rajamani R, Manjunath S, Ullas R. Chatbot For Disease Prediction And Treatment Recommendation. Turkish Journal of Computer and Mathematics Education. 2021;12(10):397-401. [3] Vijayaraghavan V, Cooper JB. Algorithm inspection for chatbot performance evaluation. Procedia Computer Science. 2020 Jan 1;171:2267-74. [4] Tebenkov E, Prokhorov I. Machine learning algorithms for teaching AI chat bots. Procedia Computer Science. 2021 Jan 1;190:735-44. [5] Chakraborty S, Paul H, Ghatak S, Pandey SK, Kumar A, Singh KU, Shah MA. An AI-based medical chatbot model for infectious disease prediction. Ieee Access. 2022 Dec 6;10:128469-83. [6] Bhirud N, Tataale S, Randive S, Nahar S. A literature review on chatbots in healthcare domain. Int J Sci Technol Res. 2019 Jul;8(7):225-31. [7] Safi Z, Abd-Alrazaq A, Khalifa M, Househ M. Technical aspects of developing chatbots for medical applications: scoping review. Journal of medical Internet research. 2020 Dec 18;22(12):e19127. [8] Jovanovi? M, Baez M, Casati F. Chatbots as conversational healthcare services. IEEE Internet Computing. 2020 Nov 11;25(3):44-51. [9] Moreira MW, Rodrigues JJ, Korotaev V, Al-Muhtadi J, Kumar N. A comprehensive review on smart decision support systems for health care. IEEE Systems Journal. 2019 Jan 13;13(3):3536-45. [10] Moreira MW, Rodrigues JJ, Korotaev V, Al-Muhtadi J, Kumar N. A comprehensive review on smart decision support systems for health care. IEEE Systems Journal. 2019 Jan 13;13(3):3536-45.
Copyright © 2024 Ms. Reshma Ashreen, Ms. Preethi M, Ms. Rukmini Bhat B. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
Paper Id : IJRASET66090
Publish Date : 2024-12-24
ISSN : 2321-9653
Publisher Name : IJRASET
DOI Link : Click Here